<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="js/simplePageBar.js"></script>
  <link rel="stylesheet" type="text/css" href="simple/css/page.css" />
  </head>
  
  <body>
<div class="classuser">
			<div class="line">查询</div>
			<div class="tableData">
			
			<form id="form">
			<input type="hidden" class="page" name="currentPage" value="1"/>
			<input type="hidden" class="perpage" name="pageSize" value="10"/>
			<div id="pageForm">
				</div>
				 <div class="inputLabel sepical">
				 <label> 巡更员：</label><input type="text" name="userName" class="text sepical"/>
				 
			
				 <input type="button" value="查询" class="query"/>
				 </div>
			</form>
				<table>
					<thead>
						<tr>
						<th>序号</th>
						    <th>姓名</th>
						     <th>
								密码
							</th><%--
							<th>
								路线名称
							</th>
							<th>
								班次名称
							</th>
							<th>
								班次时间
							</th>
							<th>
								班次类型
							</th>
							
							<th>
								排班说明
							</th>
							<th>
								操作
							</th>
						--%></tr>
					</thead>
					<tbody>

					</tbody>
				</table>
			</div>
			<!--分页样式-->
			<div class="pagerBar">
			<div class="pager">
			
			</div>
			</div>
			</div>
			
			
			
		<script type="text/javascript">
			$(function(){
					$('div.classuser').simplePageBar({
					url: '<%=basePath%>userList.action',
					dataView:loadTable
					//url:'simple/result.html'
					});
			});
			 function loadTable(data,o){
		        	if(data.success){
		    		var page = data.obj.page;
		    		var list = data.obj.list;
		    		var totalPage = page.totalPage;
		    		o.pager.empty();
					$.line.setLine(totalPage,o);
					var str="";
		    		$(list).each(function(idx,item){
		    			//alert(item.accountId);
		    			str+="<tr><td>"+item.accountId.toString()+"</td>"+
		    			"<td>"+item.username+"</td>"+
		    			"<td>"+item.password+"</td></tr>";
		    		});
		    		o.container.find('tbody').empty().append(str);
		        	}
		        
			  }
		</script>
</body>
</html>
